import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import UserView from '@/views/main/UserView.vue'
import BookView from '@/views/main/BookView.vue'
import IndexView from '@/views/main/IndexView.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/user',
          name: 'user',
          component: UserView,
          children: [
            {
              path: '/user/detail',
              name: 'detail',
              component: () => import('@/views/main/user/UserDetailsView.vue'),
            },
          ]
        },{
          path: '/index',
          name: 'index',
          component: IndexView,
          
        },{
          path: '/book',
          name: 'book',
          component: BookView,
          
        },
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('@/views/AboutView.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/LoginView.vue'),
    },
  ],
})

export default router
